/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rom.item;

import java.io.Serializable;
import rom.character.Gender;
import rom.character.Job;
import rom.character.Upper;
import rom.script.Script;
import rom.sprite.Sprite;

/**
 *
 * @author Luis
 */
public class Item implements Serializable {

    private int id;
    private int viewId;
    private String eName;
    private String jName;
    private ItemType itemType;
    private int salePrice;
    private int purchasePrice;
    private int weight;
    private int atack;
    private int defense;
    private int atackRange;
    private Job job;
    private int slot;
    private Upper upper;
    private Gender gender;
    private ItemLocation itemLocation;
    private int weaponLevel;
    private int equipLevel;
    private Boolean refineable;
    private Script script;
    private Script onEquipScript;
    private Script onUnequipScript;
    private Sprite sprite;
    private String description;
    private ItemRestriction itemRestriction;

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the viewId
     */
    public int getViewId() {
        return viewId;
    }

    /**
     * @param viewId the viewId to set
     */
    public void setViewId(int viewId) {
        this.viewId = viewId;
    }

    /**
     * @return the eName
     */
    public String geteName() {
        return eName;
    }

    /**
     * @param eName the eName to set
     */
    public void seteName(String eName) {
        this.eName = eName;
    }

    /**
     * @return the jName
     */
    public String getjName() {
        return jName;
    }

    /**
     * @param jName the jName to set
     */
    public void setjName(String jName) {
        this.jName = jName;
    }

    /**
     * @return the itemType
     */
    public ItemType getItemType() {
        return itemType;
    }

    /**
     * @param itemType the itemType to set
     */
    public void setItemType(ItemType itemType) {
        this.itemType = itemType;
    }

    /**
     * @return the salePrice
     */
    public int getSalePrice() {
        return salePrice;
    }

    /**
     * @param salePrice the salePrice to set
     */
    public void setSalePrice(int salePrice) {
        this.salePrice = salePrice;
    }

    /**
     * @return the purchasePrice
     */
    public int getPurchasePrice() {
        return purchasePrice;
    }

    /**
     * @param purchasePrice the purchasePrice to set
     */
    public void setPurchasePrice(int purchasePrice) {
        this.purchasePrice = purchasePrice;
    }

    /**
     * @return the weight
     */
    public int getWeight() {
        return weight;
    }

    /**
     * @param weight the weight to set
     */
    public void setWeight(int weight) {
        this.weight = weight;
    }

    /**
     * @return the atack
     */
    public int getAtack() {
        return atack;
    }

    /**
     * @param atack the atack to set
     */
    public void setAtack(int atack) {
        this.atack = atack;
    }

    /**
     * @return the defense
     */
    public int getDefense() {
        return defense;
    }

    /**
     * @param defense the defense to set
     */
    public void setDefense(int defense) {
        this.defense = defense;
    }

    /**
     * @return the atackRange
     */
    public int getAtackRange() {
        return atackRange;
    }

    /**
     * @param atackRange the atackRange to set
     */
    public void setAtackRange(int atackRange) {
        this.atackRange = atackRange;
    }

    /**
     * @return the job
     */
    public Job getJob() {
        return job;
    }

    /**
     * @param job the job to set
     */
    public void setJob(Job job) {
        this.job = job;
    }

    /**
     * @return the slot
     */
    public int getSlot() {
        return slot;
    }

    /**
     * @param slot the slot to set
     */
    public void setSlot(int slot) {
        this.slot = slot;
    }

    /**
     * @return the upper
     */
    public Upper getUpper() {
        return upper;
    }

    /**
     * @param upper the upper to set
     */
    public void setUpper(Upper upper) {
        this.upper = upper;
    }

    /**
     * @return the gender
     */
    public Gender getGender() {
        return gender;
    }

    /**
     * @param gender the gender to set
     */
    public void setGender(Gender gender) {
        this.gender = gender;
    }

    /**
     * @return the itemLocation
     */
    public ItemLocation getItemLocation() {
        return itemLocation;
    }

    /**
     * @param itemLocation the itemLocation to set
     */
    public void setItemLocation(ItemLocation itemLocation) {
        this.itemLocation = itemLocation;
    }

    /**
     * @return the weaponLevel
     */
    public int getWeaponLevel() {
        return weaponLevel;
    }

    /**
     * @param weaponLevel the weaponLevel to set
     */
    public void setWeaponLevel(int weaponLevel) {
        this.weaponLevel = weaponLevel;
    }

    /**
     * @return the equipLevel
     */
    public int getEquipLevel() {
        return equipLevel;
    }

    /**
     * @param equipLevel the equipLevel to set
     */
    public void setEquipLevel(int equipLevel) {
        this.equipLevel = equipLevel;
    }

    /**
     * @return the refineable
     */
    public Boolean getRefineable() {
        return refineable;
    }

    /**
     * @param refineable the refineable to set
     */
    public void setRefineable(Boolean refineable) {
        this.refineable = refineable;
    }

    /**
     * @return the script
     */
    public Script getScript() {
        return script;
    }

    /**
     * @param script the script to set
     */
    public void setScript(Script script) {
        this.script = script;
    }

    /**
     * @return the onEquipScript
     */
    public Script getOnEquipScript() {
        return onEquipScript;
    }

    /**
     * @param onEquipScript the onEquipScript to set
     */
    public void setOnEquipScript(Script onEquipScript) {
        this.onEquipScript = onEquipScript;
    }

    /**
     * @return the onUnequipScript
     */
    public Script getOnUnequipScript() {
        return onUnequipScript;
    }

    /**
     * @param onUnequipScript the onUnequipScript to set
     */
    public void setOnUnequipScript(Script onUnequipScript) {
        this.onUnequipScript = onUnequipScript;
    }

    /**
     * @return the sprite
     */
    public Sprite getSprite() {
        return sprite;
    }

    /**
     * @param sprite the sprite to set
     */
    public void setSprite(Sprite sprite) {
        this.sprite = sprite;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the itemRestriction
     */
    public ItemRestriction getItemRestriction() {
        return itemRestriction;
    }

    /**
     * @param itemRestriction the itemRestriction to set
     */
    public void setItemRestriction(ItemRestriction itemRestriction) {
        this.itemRestriction = itemRestriction;
    }

    @Override
    public String toString() {
        return id + ","
                + eName + ","
                + jName + ","
                + itemType + ","
                + salePrice + ","
                + purchasePrice + ","
                + weight + ","
                + atack + ","
                + defense + ","
                + atackRange + ","
                + slot + ","
                + job + ","
                + upper + ","
                + gender + ","
                + itemLocation + ","
                + weaponLevel + ","
                + equipLevel + ","
                + (String.valueOf(refineable != true ? 0 : 1)) + ","
                + viewId + ","
                + "{" + script + "}" + ","
                + "{" + onEquipScript + "}" + ","
                + "{" + onUnequipScript + "}";
    }
}
